// 通知组件
<template>
  <div class="notice">
    <div class="left">
      <icon-svg name="laba" class="laba"></icon-svg>
    </div>
    <div class="right">
      <el-carousel
        height="100px"
        direction="vertical"
        :autoplay="true"
        :interval="3000"
      >
        <el-carousel-item v-for="(item, index) in noticeList" :key="index">
          <h3 class="medium">{{ item.notice_content }}({{ item.remark }})</h3>
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      noticeList: [],
    };
  },
  mounted() {
    this.getNotice();
  },
  methods: {
    getNotice() {
      this.$http({
        url: this.$http.adornUrl("/business/enotice/query"),
        method: "get",
        params: this.$http.adornParams({
          pageNum: 1,
          pageSize: 10,
          flag: 1,
        }),
      }).then(({ data }) => {
        if (data && data.code === 0) {
          this.noticeList = data.page.records;
        }
      });
    },
  },
};
</script>

<style lang="scss">
.notice {
  width: 1000px;
  overflow: hidden;
  height: 100px;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 #d3dce6;
  margin: 0 auto;
  border-radius: 5px;
  display: flex;
  justify-content: space-around;
  .left {
    width: 200px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
  }
  .right {
    width: 800px;
    overflow: hidden;
    h3 {
      line-height: 100px;
      margin: 0;
      padding: 0;
      font-size: 20px;
    }
    .el-carousel {
      overflow: hidden !important;
    }
  }
}
</style>
